<template>
	<view class="repair-wrap">
		<view class="repair-box u-p-40 u-p-l-30 u-p-r-30">
			<view style="margin-top: 15px;">
				<view style="color: #666;">费用种类</view>
				<text style="font-weight: 700;float: right;margin-top: -20px;">{{userObj.fee_name}}</text>
				<!-- <text style="font-weight: 700;float: right;margin-top: -20px;" v-if="userObj.fee_name == 0">{{userObj.book_types}}</text>
				<text style="font-weight: 700;float: right;margin-top: -20px;" v-if="userObj.fee_name == 1">物业费</text>
				<text style="font-weight: 700;float: right;margin-top: -20px;" v-if="userObj.fee_name == 2">维修费</text>
				<text style="font-weight: 700;float: right;margin-top: -20px;" v-if="userObj.fee_name == 3">公告收益</text>
				<text style="font-weight: 700;float: right;margin-top: -20px;" v-if="userObj.fee_name == 4">代扣代缴</text>
				<text style="font-weight: 700;float: right;margin-top: -20px;" v-if="userObj.fee_name == 5">押金</text>
				<text style="font-weight: 700;float: right;margin-top: -20px;" v-if="userObj.fee_name == 6">工资</text>
				<text style="font-weight: 700;float: right;margin-top: -20px;" v-if="userObj.fee_name == 7">社保</text>
				<text style="font-weight: 700;float: right;margin-top: -20px;" v-if="userObj.fee_name == 8">个税</text>
				<text style="font-weight: 700;float: right;margin-top: -20px;" v-if="userObj.fee_name == 9">采购</text>
				<text style="font-weight: 700;float: right;margin-top: -20px;" v-if="userObj.fee_name == 10">设备维保费</text>
				<text style="font-weight: 700;float: right;margin-top: -20px;" v-if="userObj.fee_name == 11">设备维修费</text>
				<text style="font-weight: 700;float: right;margin-top: -20px;" v-if="userObj.fee_name == 12">工程材料费</text>
				<text style="font-weight: 700;float: right;margin-top: -20px;" v-if="userObj.fee_name == 13">其他</text> -->
			</view>
			<view style="margin-top: 15px;">
				<view style="color: #666;">楼宇号</view>
				<text style="font-weight: 700;float: right;margin-top: -20px;">{{name}}{{address}}</text>
			</view>
			<view style="margin-top: 15px;">
				<view style="color: #666;">发票金额</view>
				<text style="font-weight: 700;float: right;margin-top: -20px;">{{userObj.amount_of_money}}</text>
			</view>
			<view style="margin-top: 15px;">
				<view style="color: #666;">发票类型</view>
				<text style="font-weight: 700;float: right;margin-top: -20px;" v-if="userObj.invoice_type == 1">增值税普通发票（纸质发票）</text>
				<text style="font-weight: 700;float: right;margin-top: -20px;" v-if="userObj.invoice_type == 2">增值税专用发票（纸质发票）</text>
				<text style="font-weight: 700;float: right;margin-top: -20px;" v-if="userObj.invoice_type == 3">增值税普通发票（电子版）</text>
				<text style="font-weight: 700;float: right;margin-top: -20px;" v-if="userObj.invoice_type == 4">增值税专用发票（电子版）</text>
			</view>
			<view style="margin-top: 15px;">
				<view style="color: #666;">抬头</view>
				<text style="font-weight: 700;float: right;margin-top: -20px;">{{userObj.rise}}</text>
			</view>
			<view style="margin-top: 15px;">
				<view style="color: #666;">纳税人识别码</view>
				<text style="font-weight: 700;float: right;margin-top: -20px;">{{userObj.taxpayer_identification_code}}</text>
			</view>
			<view style="margin-top: 15px;">
				<view style="color: #666;">地址</view>
				<text style="font-weight: 700;float: right;margin-top: -20px;">{{userObj.rise_address}}</text>
			</view>
			<view style="margin-top: 15px;">
				<view style="color: #666;">电话</view>
				<text style="font-weight: 700;float: right;margin-top: -20px;">{{userObj.rise_telephone}}</text>
			</view>
			<view style="margin-top: 15px;">
				<view style="color: #666;">开户行</view>
				<text style="font-weight: 700;float: right;margin-top: -20px;">{{userObj.bank_of_deposit}}</text>
			</view>
			<view style="margin-top: 15px;">
				<view style="color: #666;">账号</view>
				<text style="font-weight: 700;float: right;margin-top: -20px;">{{userObj.account_number}}</text>
			</view>
		</view>
		
		<view class="repair-box u-p-40 u-p-l-30 u-p-r-30">
			<view style="margin-top: 15px;">
				<view style="color: #666;">取票方式</view>
				<text style="font-weight: 700;float: right;margin-top: -20px;" v-if="userObj.ticket_collection_method == 1">自取</text>
				<text style="font-weight: 700;float: right;margin-top: -20px;" v-if="userObj.ticket_collection_method == 2">快递</text>
				<text style="font-weight: 700;float: right;margin-top: -20px;" v-if="userObj.ticket_collection_method == 3">邮箱</text>
			</view>
			<view style="margin-top: 10px;" v-if="userObj.ticket_collection_method == 1">
				<text style="color: #999;">请在{{userObj.receive_day}}个工作日后在该项目的物业管理中心领取发票</text>
			</view>
			<view v-if="userObj.ticket_collection_method != 1">
				<view style="margin-top: 15px;">
					<view style="color: #666;">姓名</view>
					<text style="font-weight: 700;float: right;margin-top: -20px;">{{userObj.ticket_collector_name}}</text>
				</view>
				<view style="margin-top: 15px;">
					<view style="color: #666;">电话</view>
					<text style="font-weight: 700;float: right;margin-top: -20px;">{{userObj.ticket_collector_phone}}</text>
				</view>
				<view style="margin-top: 15px;" v-if="userObj.detailed_address != null">
					<view style="color: #666;">地址</view>
					<text style="font-weight: 700;float: right;margin-top: -20px;">{{userObj.detailed_address}}</text>
				</view>
				<view style="margin-top: 15px;" v-if="userObj.uploader_name != null">
					<view style="color: #666;">开票人</view>
					<text style="font-weight: 700;float: right;margin-top: -20px;">{{userObj.uploader_name}}</text>
				</view>
				<view style="margin-top: 15px;" v-if="userObj.upload_time != null">
					<view style="color: #666;">开票时间</view>
					<text style="font-weight: 700;float: right;margin-top: -20px;">{{userObj.upload_time}}</text>
				</view>
				<view style="margin-top: 15px;" v-if="userObj.invoice_remarks != null">
					<view style="color: #666;">备注</view>
					<view style="margin-top: 5px;color: #999;font-weight: 700;margin-left: 15px;">{{userObj.invoice_remarks}}</view>
				</view>
				
				<view style="margin-top: 15px;" v-if="userObj.invoice_photo_first != null">
					<view style="color: #666;">开票方式</view>
					<view style="margin-top: 5px;width: 100px;height: 100px;">
						<image style="width: 100%;height: 100%;" @click="preview(userObj.invoice_photo_first)" :src="userObj.invoice_photo_first" mode=""></image>
					</view>
				</view>
				<view style="margin-top: 15px;" v-if="userObj.express_name != null">
					<view style="color: #666;">快递名称</view>
					<text style="font-weight: 700;float: right;margin-top: -20px;">{{userObj.express_name}}</text>
				</view>
				<view style="margin-top: 15px;" v-if="userObj.courier_number != null">
					<view style="color: #666;">快递单号</view>
					<text style="font-weight: 700;float: right;margin-top: -20px;">{{userObj.courier_number}}</text>
				</view>
				
			</view>
			
		</view>
		<!-- <view class="bill-deta-btn" v-if="userObj.ticket_collection_method == 1">
			<button class="yilingqu" @click="handleInvoice" >确认领取</button>
		</view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type:1,
				index:0,
				userObj:{},
				homelist: '',
				name: '',
				address: '',
			}
		},
		onLoad(options) {
			const item = JSON.parse(decodeURIComponent(options.item))
			this.userObj =item
			console.log(this.userObj)
		},
		onShow() {
			this.homelist = uni.getStorageSync('hourseList')[uni.getStorageSync('hourseNum') || 0]
			this.name = this.homelist.proName;
			this.address = this.homelist.buildDistrictCode + '-' + this.homelist.buildTowerCode + '-' + this.homelist
							.roomUnitNumber +
					'-' + this.homelist.roomCode
			this.money = this.$Route.query.money
			this.chooseList = this.$Route.query.chooseList
			// this.getBillDetail()
		
		},
		methods: {
			// 图片预览
			preview(item) {
				uni.previewImage({
					urls: [item],
					current: 0,
					longPressActions: {
						success: function(data) {
							console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
						},
						fail: function(err) {
							console.log(err.errMsg);
						}
					}
				});
			},
		}
	}
</script>


<style lang="scss">
	.repair-wrap {
		width: 100%;
		min-height: 100vh;
		height: auto;
		background: #f4f4f4;
		overflow: hidden;

		.repair-box {
			background: #fff;

			.repair-titel {
				height: 44rpx;
				line-height: 44rpx;

				.repair-titel-l {
					float: left;
				}

				.repair-titel-r {
					float: right;
					color: #999;
				}
			}

			.repair-6 {
				color: #666;
			}
		}
	}
	.tab_nav{
		display: flex;
		justify-content: center;
		align-items: center;
	}
	.tab_nav  .navTitle {
		height: 90rpx;
		line-height: 90rpx;
		width: 100%;
		text-align: center;
		font-size: 32rpx;
		font-family: Alibaba PuHuiTi;
		color: #333;
	}
	.active {
		position: relative;
		color: #427705 ;
	}
	.active::after {
		content: "";
		position: absolute;
		width: 100rpx;
		height: 4rpx;
		background-color: #427705 ;
		left: 0px;
		right: 0px;
		bottom: 0px;
		margin: auto;
	}
	.bill-deta-btn {
		width: 100%;
		padding: 25px 0;
		.pay{
			background: #ff9900 !important;
			color: #fff;
		}
		.yilingqu{
			width: 80%;
			height: 84rpx;
			// background:#F9A832;
			// background-color: #F9A832;
			background: linear-gradient(180deg, #76D904 0%,#417505 100%);
			border-radius: 44rpx;
			line-height: 84rpx;
			color: #FFFFFF;
			text-align: center;
			font-size: 32rpx;
		}
	}
</style>
